import { post } from '@/request/http'

import store from '@/store'

/**
 * 平台管理--管理 接口
 *
 */

/**
 * 获取左侧列表数据
 */

export const checkSysList = (data) =>
  post(
    '/FTKJWLHYPT/platform/queryModelManagerList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            mdlIsp: data.mdlIsp
          }
        },
        Orderbys: {},
        PageIndexs: {},
        PageSizes: {}
      }
    }
  )

// 右边查询详情
export const checkInfoList = data =>
  post(
    '/DXNXTD/ControlPath?act=list&actKey=SysModule&Section=listb&SessionId=' +
    store.state.user.SessionId_DX_H,
    {
      Data: {
        Filters: {
          DXNXTD: {
            FLT_UUID: store.state.user.FLT_UUID_DX_H,
            UUID: data.UUID
          }
        },
        Orderbys: {},
        PageIndexs: {},
        PageSizes: {}
      }
    }
  )
// 编辑
export const editInfoList = (data) =>
  post(
    '/FTKJWLHYPT/platform/editModel',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            mdlId: data.mdlId,
            mdlSeq: data.mdlSeq,
            mdlCode: data.mdlCode,
            mdlLevel: data.mdlLevel,
            mdlName: data.mdlName,
            mdlUrl: data.mdlUrl,
            mdlIsp: data.mdlIsp,
            mdlValid: data.mdlValid,
            mdlType: data.mdlType,
            mdlParent: data.mdlParent,
            sysModuleList: data.sysModuleList
          }
        },
      }
    }
  )

// 右边数据新增addInfoList
export const addInfoList = (data) =>
  post(
    '/FTKJWLHYPT/platform/addModel',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            mdlSeq: data.mdlSeq,
            mdlCode: data.mdlCode,
            mdlLevel: data.mdlLevel,
            mdlName: data.mdlName,
            mdlUrl: data.mdlUrl,
            mdlIsp: data.mdlIsp,
            mdlValid: data.mdlValid,
            mdlType: data.mdlType,
            mdlParent: data.mdlParent,
            sysModuleList: data.sysModuleList,
          }
        },
      }
    }
  )
// 删除
export const delInfoList = (data) =>
  post(
    '/FTKJWLHYPT/platform/deleteModel',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            mdlId: data.mdlId,
            mdlCode: data.mdlCode,
            mdlParent: data.mdlParent,
          }
        },
      }
    }
  )
